package com.rock.code.bigdata.bigdatainterface.service;
import com.rock.code.bigdata.bigdatainterface.service.HistoryDataService;
import org.apache.log4j.Logger;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import java.text.SimpleDateFormat;
import java.util.Date;


/**
 * @author zhouhao
 * @description 定时更新静态数据
 * @date 2018/9/13 11:33
 * @Version 1.0
 */
public class updateStaticTask implements Job {

    Logger logger = Logger.getLogger("schedule");
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd  HH:mm:ss");

    /**
     * 设置每月更新静态属性值
     *
     * @param jobExecutionContext
     * @throws JobExecutionException
     */
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {

        HistoryDataService historyDataService = (HistoryDataService) jobExecutionContext.getMergedJobDataMap().get("createTabService");
        historyDataService.deleteAll();
        //获取数据更新时间
        Date today = new Date();
        String updateTime=sdf.format(today);
//        historyDataService.saveStaticData();

    }



}
